package com.gujianjian.testjwt.service;

import com.gujianjian.testjwt.dto.AccountDTO;
import com.gujianjian.testjwt.exceptions.LoginFailed;
import com.gujianjian.testjwt.vo.AccountVO;
import org.springframework.stereotype.Service;

/**
 * @author 顾小健
 * @create: 2021-12-12
 */
@Service
public class AccountService {

    public void login(String userName,String password){
        if (!"guxiaojian".equals(userName) && "123456".equals(password)) {
            throw new LoginFailed();
        }
    }

    public AccountDTO getByUserName(String userId) {
        return new AccountDTO();
    }
    public AccountVO getAccountByUserName(String username) {
        AccountVO accountVO=new AccountVO();
        accountVO.setNickname("比克大魔王");
        accountVO.setRealname("顾健健");
        accountVO.setUserId("123456");
        accountVO.setUsername(username);
        return accountVO;
    }
}
